#ifndef __GLF_COMPILER_GCC_H_INCLUDED__
#define __GLF_COMPILER_GCC_H_INCLUDED__

typedef   signed long long int64;
typedef unsigned long long uint64;

typedef __SIZE_TYPE__ size_t;

namespace glf {
	void* alloca(size_t size);
	typedef int errno_t;
	//typedef __SIZE_TYPE__ size_t;
} //namespace glf

#define STD_NAMESPACE

#define GLF_ATTRIBUTE_ALIGN(num)	__attribute__((aligned(num)))
#define GLF_ALIGNOF(type)			__alignof__(type)
#define GLF_STRUCT_PACK(num) 
#define GLF_BREAKPOINT()			//{ _asm int 3 }`
#define GLF_COMPILER_OFFSETOF(s,m)		offsetof(s,m)

#define GLF_REMINDER(msg)			message("REMINDER: " msg)

#if defined(__APPLE__)
	#define GLF_HAS_BUILTIN_COMPILER_TLS 0
#elif defined(__ANDROID__)

	// *** From the ndk/docs/system/libc/OVERVIEW.html
	//
	// At the moment, thread-local storage defined through the __thread compiler
	// keyword is not supported by the Bionic C library and dynamic linker.	

#	define GLF_HAS_BUILTIN_COMPILER_TLS 0

#else
	#define GLF_HAS_BUILTIN_COMPILER_TLS 1
	#define GLF_BUILTIN_TLS_DECL __thread
#endif

#include <stdarg.h>

typedef va_list			glfVaList;

#define glfVaStart(l, arg)	va_start(l, arg)
#define glfVaEnd(v)			va_end(v)
#define glfVaArg(v,l)		va_arg(v,l)

//#pragma warning(disable:4100)
//#pragma warning(disable:4505) //unreferenced local function has been removed
//#pragma warning(disable:4201) //nonstandard extension used : nameless struct/union


#endif
